package com.library.book.util;

/**
 * 图书状态类别枚举类
 */
public enum BookState {

	ENABLE_BORROW("在库可借", BookState.ENABLE_BORROW_STATE),
	BORROWED("已借出", BookState.BORROWED_STATE),
	LOST("丢失", BookState.LOST_STATE);

	private final static int ENABLE_BORROW_STATE = 0;		//在库可借
	private final static int BORROWED_STATE = 1;		//已借出
	private final static int LOST_STATE = 2;		//丢失

	private String name;
	private int state;

	BookState(String name, int state) {
		this.name = name;
		this.state = state;
	}

	/**
	 * 获取状态类别名称
	 *
	 * @return
	 */
	public String getName() {
        return name;
    }

    /**
     * 获取状态类型
     *
     * @return
     */
    public int getState() {
        return state;
    }
}
